//
//  MeTableViewCell.m
//  AILove
//
//  Created by 甘世清 on 2023/12/17.
//

#import "MeTableViewCell.h"

@implementation MeTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (void)SQ_Style:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    [self.contentView addSubview:self.leftImage];
    [self.leftImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView);
        make.left.equalTo(self.contentView).offset(18);
        make.size.mas_equalTo(16);
    }];
    [self.contentView addSubview:self.nameLabel];
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.contentView);
            make.left.equalTo(self.contentView).offset(48);
    }];
    UIImageView * image = [[UIImageView alloc]init];
    image.image = SQGetImage(@"箭头");
    image.contentMode = UIViewContentModeScaleAspectFit;
    [self.contentView addSubview:image];
    [image mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(20);
            make.centerY.equalTo(self.contentView);
            make.right.equalTo(self.contentView.mas_right).offset(-20);
    }];
    UIView * lineView = [[UIView alloc]init];
    lineView.backgroundColor = SQColor(@"#262323");
    [self.contentView addSubview:lineView];
    [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(1);
        make.left.equalTo(self.contentView).offset(16);
        make.bottom.equalTo(self.contentView);
        make.right.equalTo(self.contentView.mas_right).offset(-20);
    }];
}
- (void)setName:(NSString *)name{
    _name = name;
    _leftImage.image = SQGetImage(name);
    self.nameLabel.text = SQNSLocalString(name);
}
- (UIImageView *)leftImage{
    if (!_leftImage) {
        _leftImage = [[UIImageView alloc]init];
        _leftImage.contentMode = UIViewContentModeScaleAspectFit;
    }
    return _leftImage;
}
- (UILabel *)nameLabel{
    if (!_nameLabel) {
        _nameLabel = [[UILabel alloc]init];
        _nameLabel.font = FONT_BOLD(16);
        _nameLabel.textColor = SQColorF5F5F5;
       
    }
    return _nameLabel;
}

@end
